package com.allwees.bs.task.order.sync;

import com.allwees.bs.module.lms.service.LogisticWaybillService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 向51tracking订阅订单状态-手动执行
 */
@Slf4j
@Service
public class TrackOrderManualTask {

    @Resource
    private LogisticWaybillService logisticWaybillService;

    @XxlJob(value = "trackOrderManualTask")
    public ReturnT<String> run(String s) {
//        List<LogisticsWaybill> list = logisticWaybillService.findListByFieldValues("channel_code", "usps");
//        List<TrackingObj> trackList = list.stream().map(TrackingObj::new).distinct().collect(Collectors.toList());
//        log.info(">>> register to 51tracking,track list size:{}",trackList.size());
//        for (TrackingObj trackingObj : trackList) {
//            TrackingHelper.trackOne(trackingObj);
//        }
        return ReturnT.SUCCESS;
    }
}
